package com.ks.common.enums;

import lombok.Getter;

/**
 * 商业代码枚举
 *
 * @author KingAusten
 * @date 2022/08/17 17:54:51
 */
public enum BizCodeEnum{

    /**
     * 账号
     */
    ACCOUNT_REPEAT(250001,"账号已经存在"),
    ACCOUNT_UNREGISTER(250002,"账号不存在"),
    ACCOUNT_PWD_ERROR(250003,"账号或者密码错误"),
    ACCOUNT_UNLOGIN(250004,"账号未登录"),

    /**
     * 订单
     */
    ORDER_CONFIRM_PRICE_FAIL(280002,"创建订单-验价失败"),
    ORDER_CONFIRM_REPEAT(280008,"订单恶意-重复提交"),
    ORDER_CONFIRM_TOKEN_EQUAL_FAIL(280009,"订单令牌缺少"),
    ORDER_CONFIRM_NOT_EXIST(280010,"订单不存在"),

    /**
     * 支付
     */
    PAY_ORDER_FAIL(300001,"创建支付订单失败"),
    PAY_ORDER_CALLBACK_SIGN_FAIL(300002,"支付订单回调验证签失败"),
    PAY_ORDER_CALLBACK_NOT_SUCCESS(300003,"支付宝回调更新订单失败"),
    PAY_ORDER_NOT_EXIST(300005,"订单不存在"),
    PAY_ORDER_STATE_ERROR(300006,"订单状态不正常"),
    PAY_ORDER_PAY_TIMEOUT(300007,"订单支付超时"),
    ;

    /**
     * 消息
     */
    @Getter
    private final String msg;

    /**
     * 编码
     */
    @Getter
    private final int code;

    /**
     * @param code 编码
     * @param msg  消息
     *             <p>
     *             商业代码枚举
     *
     * @return
     */
    BizCodeEnum(int code,String msg){

        this.code = code;
        this.msg = msg;
    }
}
